package com.cm.caseManagement.service.impl;


import com.cm.caseManagement.dao.CmAiMessagesMapper;
import com.cm.caseManagement.pojo.entity.CmAiMessages;
import com.cm.caseManagement.service.ICmAiMessagesService;
import com.cm.caseManagement.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 消息Service业务层处理
 *
 * @author ruoyi
 * @date 2025-10-05
 */
@Service
public class CmAiMessagesServiceImpl implements ICmAiMessagesService
{
    @Autowired
    private CmAiMessagesMapper cmAiMessagesMapper;

    /**
     * 查询消息
     *
     * @param id 消息主键
     * @return 消息
     */
    @Override
    public CmAiMessages selectCmAiMessagesById(Long id)
    {
        return cmAiMessagesMapper.selectCmAiMessagesById(id);
    }

    /**
     * 查询消息列表
     *
     * @param cmAiMessages 消息
     * @return 消息
     */
    @Override
    public List<CmAiMessages> selectCmAiMessagesList(CmAiMessages cmAiMessages)
    {
        return cmAiMessagesMapper.selectCmAiMessagesList(cmAiMessages);
    }

    /**
     * 新增消息
     *
     * @param cmAiMessages 消息
     * @return 结果
     */
    @Override
    public int insertCmAiMessages(CmAiMessages cmAiMessages)
    {
        cmAiMessages.setCreateTime(DateUtils.getNowDate());
        return cmAiMessagesMapper.insertCmAiMessages(cmAiMessages);
    }

    /**
     * 修改消息
     *
     * @param cmAiMessages 消息
     * @return 结果
     */
    @Override
    public int updateCmAiMessages(CmAiMessages cmAiMessages)
    {
        return cmAiMessagesMapper.updateCmAiMessages(cmAiMessages);
    }

    /**
     * 批量删除消息
     *
     * @param ids 需要删除的消息主键
     * @return 结果
     */
    @Override
    public int deleteCmAiMessagesByIds(Long[] ids)
    {
        return cmAiMessagesMapper.deleteCmAiMessagesByIds(ids);
    }

    /**
     * 删除消息信息
     *
     * @param id 消息主键
     * @return 结果
     */
    @Override
    public int deleteCmAiMessagesById(Long id)
    {
        return cmAiMessagesMapper.deleteCmAiMessagesById(id);
    }
}
